Improvements based on the review
authorYehuda Katz <wycats@gmail.com>
Tue, 1 Jul 2014 06:27:33 +0000 (23:27 -0700)
committerYehuda Katz <wycats@gmail.com>
Tue, 1 Jul 2014 06:27:33 +0000 (23:27 -0700)
src/cargo/ops/cargo_read_manifest.rs

index e21472af1a736e28e22d0b0467bb3e1881810e04..83eeca006f746e746ea9a724094d89072c9891ca 100644 (file)
@@ -35,7 +35,7 @@ pub fn read_packages(path: &Path,
     try!(walk(path, true, |dir| {
         log!(5, "looking for child package: {}", dir.display());
         if dir.filename_str() == Some(".git") { return Ok(false); }
-        if dir.join(".git").is_dir() { return Ok(false); }
+        if dir.join(".git").exists() { return Ok(false); }
         try!(process_possible_package(dir, &mut all_packages, source_id, &mut visited));
         Ok(true)
     }));
@@ -90,9 +90,9 @@ fn read_nested_packages(path: &Path, source_id: &SourceId,
     let mut ret = vec![pkg];
 
     for p in nested.iter() {
-        ret.push_all(try!(read_nested_packages(&path.join(p),
+        ret.push_all_move(try!(read_nested_packages(&path.join(p),
                                         source_id,
-                                        visited)).as_slice());
+                                        visited)));
     }
 
     Ok(ret)